<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>${registration.name }</title>
<meta name="viewport"
	content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="../css/base.css" />
<link rel="stylesheet" href="../css/index_five.css" />
<link rel="stylesheet" href="../css/mui/mui.css" />
<!--<link rel="stylesheet" href="css/index_five_tanchu.css" />-->
<link rel="stylesheet" href="../css/tanchucss/pushbutton.css" />
<!--<link rel="stylesheet" href="css/tanchucss/tanchu.css" />-->
<script src="../js/mui/mui.js"></script>
<script src="../js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="${ctx}/layui/layui.all.js"></script>
<link rel="stylesheet" type="text/css" href="${ctx}/layui/css/layui.css">
<script type="text/javascript" src="${ctx}/js/layui_common.js"></script>
<link href="${ctx}/css/uploadcss/iconfont.css" rel="stylesheet"
	type="text/css" />
<link href="${ctx}/css/uploadcss/fileUpload.css" rel="stylesheet"
	type="text/css">
<script type="text/javascript" src="${ctx}/js/uploadjs/fileUpload.js"></script>

<!--<script src="js/jquery/jquery-2.1.4.min.js"></script>-->
<script src="../js/tanchu/require.js"></script>
<script>
	$(function() {
		//				var clientW =  document.documentElement.clientWidth;
		var clientW = $(window).width();
		var originW = 750;
		var bili = clientW / originW * 100 + "px";
		document.querySelector("html").style.fontSize = bili;
		var h = window.innerHeight;
		$("#container").css('height', h);
		})
</script>
</head>
<body>
	<div id="container">
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title font_color">设备名称：${registration.name } </h1>
			<input type="hidden" id="deviceid" value="${registration.deviceid }">
		</header>

		<div class="mui-content" style="width: 95%;">
			<div class="one_img">
				<img src="${registration.img }" alt="" />
			</div>
			<div class="five_shebei">
				<p>
					设备名称：<span>${registration.name }</span>
				</p>
				<p>
					设备编号：<span>${registration.devicecode }</span>
				</p>
				<p>
					安装时间：<span>${registration.createtime }</span>
				</p>
				<p>
					安装单位：<span>${registration.company }</span>
				</p>
				<p>
					包保人员：<span>${registration.kaneyasu_name }</span>
				</p>
			</div>
			<div class="five_jilu">
				<span>记录列表</span>
			</div>
			<c:if test="${registrations == null }">
				<div class="list_cent"></div>
			</c:if>
			<c:if test="${registrations != null }">
				<c:forEach items="${registrations }" var="registration">
					<div class="list_cent">
						<div class="list_left">
							<img src="../images/8888@2x(1).png" alt="" />
							<div class="left_shu"></div>
						</div>
						<div class="list_right">
							<c:if test="${registration.type=='1' }">
								<div class="rg_head">安装记录</div>
							</c:if>
							<c:if test="${registration.type=='2' }">
								<div class="rg_head">巡检记录</div>
							</c:if>
							<c:if test="${registration.type=='3' }">
								<div class="rg_head">维修记录</div>
							</c:if>
							<div class="list_two">
								<div class="rg_time">
									时间:&nbsp;<span>${registration.createtime }</span>
								</div>
								<div class="rg_name">
									姓名:&nbsp;<span>${registration.username }</span>
								</div>
							</div>
							<div class="rg_img">
									<c:forEach items="${registration.img}" var="img">
										<img src="${img}" alt="" />
									</c:forEach> 
								<%-- </c:if>  --%>
							</div>
							<div class="rg_xx">
								<div>详细信息:</div>
								<span> ${registration.context }</span>
							</div>
							<div class="rg_dingwei">
								<img src="../images/147147@2x.png" alt="" /> <span>${registration.address }</span>
							</div>
						</div>
					</div>
				</c:forEach>
			</c:if>


			<div class="list_fixed"></div>
			<div class="five_foot">
				<button class="five_tijiao" id="showUserPicker">
					<a href="javascript:void(0);" id="pushbuttonClick">添加记录</a>
				</button>
			</div>
		</div>
		<section id="pushbutton" class="pushbutton"></section>
	</div>
</body>
<!--弹出层start-->
<script>
	require(
			[ 'zepto', 'pushbutton' ],
			function() {
				var Pushbutton = require('pushbutton');
				var options = {
					isShow : false, // 默认是否显示
					maxHeight: 210,
					data : [ {
						text : '安装记录',
					}, {
						text : '巡检记录',
					}, {
						text : '维修记录',
					} ],
					// 点击回调 返回true 则不隐藏弹出框
					onClick : function(e) { 
						var deviceid = "";
						var that = this;
						if (e.index == "0") {
							if(${registration.deviceid =="" || registration.deviceid ==null}){
								layer.alert("设备维修登记记录为空，暂不能加维修记录!");
							} else {
								deviceid = $("#deviceid").val();
								that.location.href = "${ctx}/registrationRecord/getRegistrationRecordByDeviceId?deviceid="+deviceid
							}
						} else if (e.index == "1") {
							if(${registration.deviceid =="" || registration.deviceid ==null}){
								layer.alert("设备维修登记记录为空，暂不能加维修记录!");
							} else {
								deviceid = $("#deviceid").val();
								that.location.href = "${ctx}/registrationRecord/getRegistrationRecordByDeviceIdXj?deviceid="+ deviceid
							}
						} else if (e.index == "2") {
							if(${registration.deviceid =="" || registration.deviceid ==null}){
								layer.alert("设备维修登记记录为空，暂不能加维修记录!");
							} else {
								deviceid = $("#deviceid").val();
								that.location.href = "${ctx}/registrationRecord/getRegistrationRecordByDeviceIdWx?deviceid="+ deviceid
							}
						} else if (e.index == "3") {
							//		 				that.location.href = "index_five.html"
							that.history.go(-1);
						}
						// 返回主要有用数据
						return true;
					},
				};
				var pub = new Pushbutton('#pushbutton', options);
				options.show = false;
				var dom = document.getElementById("pushbuttonClick");
				dom.onclick = function() {
					pub.show();
				}

			});
	require.config({
		paths : {
			"zepto" : "../js/tanchu/zepto.min",
			"pushbutton" : "../js/tanchu/pushbutton"
		}
	});
</script>
<!--弹出层end-->

</html>